import React from 'react';
import propTypes from 'prop-types'
import {classHelper} from '../utils/class'

const formattedMessage = (props) => {
  return (
    <div {...props}
         className={classHelper(props.className)}
         style={{
           color: props.color,
           fontSize: props.fontSize,
           fontWeight: props.fontWeight, ...props.style,
           cursor: props.onClick ? 'pointer' : ''
         }}

    >
      {props.message}
    </div>
  );
  S
};

formattedMessage.propTypes = {
  message: propTypes.oneOfType([
    propTypes.string,
    propTypes.element,
  ]),
  color: propTypes.string,
  fontSize: propTypes.oneOfType([
    propTypes.number,
    propTypes.string
  ]),
  fontWeight: propTypes.oneOfType([
    propTypes.number,
    propTypes.string
  ]),
  onClick: propTypes.func,
};
formattedMessage.defaultProps = {
  onClick: null
};

export default formattedMessage;
